/*w我的服务Item*/
import 'package:flutter/cupertino.dart';
import 'package:frametrim/utility/screen.dart';
import 'package:frametrim/utility/sq_color.dart';

class ServiceView extends StatelessWidget {
  final Color backgroundColor;
  final String imgStr;
  final String name;
  final VoidCallback onPress;

  ServiceView(this.backgroundColor, this.imgStr, this.name, this.onPress);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: onPress,
      child: Container(
        height: 60,
        margin: EdgeInsets.only(top: 10),
        padding: EdgeInsets.only(left: 12, right: 12),
        width: Screen.width - 44,
        decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(5), color: backgroundColor),
        child: Row(
          children: <Widget>[
            Image.asset(
              imgStr,
              width: 28,
              height: 28,
            ),
            SizedBox(
              width: 15,
            ),
            Text(
              name,
              style: TextStyle(fontSize: 16, color: SQColor.color_333333),
            )
          ],
        ),
      ),
    );
  }
}
